# Contributor: Steven Guikal <void@fluix.one>
# Maintainer: Steven Guikal <void@fluix.one>
pkgname=py3-pydantic-settings
pkgdesc="Settings management using pydantic"
pkgver=2.2.1
pkgrel=0
# loongarch64: blocked by py3-pydantic
arch="noarch !loongarch64"
url="https://github.com/pydantic/pydantic-settings"
license="MIT"
depends="python3
	py3-dotenv
	py3-pydantic
	py3-typing-extensions
	"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-pytest-mock
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pydantic/pydantic-settings/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/pydantic-settings-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages testenv
	testenv/bin/python3 -m installer dist/*.whl
	# test_docs.py needs pytest-examples which is not packaged
	testenv/bin/python3 -m pytest --ignore=tests/test_docs.py
}

package() {
	python3 -m installer -d "$pkgdir" dist/*.whl
}

sha512sums="
a90b92e85f6722321c90c0c09bd332d9ec9550c42f2c8b797bfd212532699e4d6536eec19ef172ead0aaa25fd4ef984f6694d8c957852f59ab2d45be4e29c199  py3-pydantic-settings-2.2.1.tar.gz
"
